With Timeout Statements
When AppleScript sends a command to an application, it normally waits for the command to complete execution before continuing with the rest of the script. If the command takes longer than one minute to complete, AppleScript stops running the script and returns the error"event timed out"
.With Timeout statements let you change how long AppleScript waits before stopping execution of a script. The amount of time you specify in a With Timeout statement applies to some types of commands within the statement that are sent to other applications, but not to any commands sent to the application that's running the script.
The specified time applies to all application commands and to any scripting addition commands whose targets are application objects--that is,
scripting addition commands within Tell statements to application objects
or scripting addition commands whose direct parameters are application objects. The time specified by a With Timeout statement does not apply to AppleScript commands, AppleScript operations, or scripting addition commands whose targets are not application objects.
- Note
- If you want AppleScript to proceed to the next statement without waiting for application commands to complete, use an Ignoring statement to ignore the
application responses
attribute. For more information, see "Considering and Ignoring Statements" on page 214.![]()